﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;


namespace TheNerd
{

    public enum ItemType
    {
        Nerd,
        Computer,
        Door,
        Wall,
        Tree,
        LoveInterest,
        RomanticCompetitor,
    }

    public enum Sex
    {
        Male,
        Female,
    }

    public class CollisionEventArgs : EventArgs
    {

    }

    public abstract class LevelItem
    {
        protected Vector2 _position;
        protected Texture2D _graphic;
        protected Rectangle _boundary;
        protected ItemType _itemType;
        protected int _id;

        public event EventHandler<CollisionEventArgs> RaiseCollisionEvent;

        public Vector2 Position
        {
            get { return _position; }
            set { _position = value; }
        }

        public Texture2D Graphic
        {
            get { return _graphic; }
            set { _graphic = value; }
        }

        public Rectangle Boundary
        {
            get
            {
                _boundary = new Rectangle((int)_position.X, (int)_position.Y, _graphic.Width, _graphic.Height);
                return _boundary;
            }
            //set { _boundary = value; }
        }

        public ItemType Type
        {
            get { return _itemType; }
            set { _itemType = value; }
        }

        public int ID
        {
            get { return _id; }
        }


        public LevelItem(int id)
        {
            _id = id;
        }

        protected void raiseCollisionEvent(CollisionEventArgs args)
        {
            if (RaiseCollisionEvent != null)
            {
                RaiseCollisionEvent(this, args);
            }

        }



    }


    public class Nerd : LevelItem
    {
        protected Sex _sex = Sex.Male;

        public Sex Gender
        {
            get { return _sex; }
        }


        public Nerd(int id)
            : base(id)
        {

        }


    }


    public class Door : LevelItem
    {
        public Door(int id)
            : base(id)
        {

        }

    }


    public class Wall : LevelItem
    {

        public Wall(int id)
            : base(id)
        {

        }
    }

    public class Computer : LevelItem
    {

        public Computer(int id)
            : base(id)
        {

        }

    }

    public class LoveInterest : LevelItem
    {

        public LoveInterest(int id)
            : base(id)
        {

        }

    }



}